# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=konqueror
pkgver=24.02.2
pkgrel=0
pkgdesc="KDE File Manager & Web Browser"
# armhf blocked by extra-cmake-modules
# s390x, ppc64le, riscv64 and armv7 blocked by qt6-qtwebengine
arch="all !armhf !s390x !ppc64le !riscv64 !armv7"
url="https://konqueror.org/"
license="GPL-2.0-or-later AND GFDL-1.2-only AND LicenseRef-KDE-Accepted-LGPL"
makedepends="
	extra-cmake-modules
	plasma-activities-dev
	karchive-dev
	kcmutils-dev
	kcrash-dev
	kdbusaddons-dev
	kdesu-dev
	kdoctools-dev
	kiconthemes-dev
	kparts-dev
	kwindowsystem-dev
	qt6-qtbase-dev
	qt6-qtwebengine-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/network/konqueror.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/konqueror-$pkgver.tar.xz"
options="!check" # Tests hang

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure -E "(sidebar-modulemanager|konqpopupmenu|webengine_partapi_)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
29b7e14e68481f6b155c8d17dda9ae21858213c9fdb5a812c761d40469ca1339f0e237e57f1687a6e000a2ed54060dbe1b2f1ee1bc382dd662975ddda8305717  konqueror-24.02.2.tar.xz
"
